std::pow

From Cppreference

Jump to: navigation, search
Defined in header <cmath>

float       pow( float base, float exp );

double      pow( double base, double exp );

long double pow( long double base, long double exp );

float       pow( float base, int iexp );

double      pow( double base, int iexp );

long double pow( long double base, int iexp );

Computes the base raised by power exp or iexp.

Parameters

base - base as floating point value
exp - exponent as floating point value
iexp - exponent as integer value

Return value

base raised by power (exp or iexp).

Domain error occurs if base is 0 and exp is less than or equal to 0. ​NAN​ is returned in that case.

Domain error occurs if base is negative and exp is not an integer value. ​NAN​ is returned in that case.

Range error occurs if an overflow takes place. ​HUGEVAL​ is returned in that case.

See also

exp
returns e raised to the given power
(function)
log
natural logarithm (to base e)
(function)
sqrt
square root
(function)
cbrt (C++0x)
cubic root
(function)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages